//获取应用实例
const app = getApp();
Page({
	data:{
		phoneInput:''
	},
	onLoad:function(){

	},
	phoneInput:function(e){
		this.setData({
			phoneInput:e.detail.value
		})
	},
	formSubmit: function(e) {
		if(!e.detail.value.phone){
			wx.showToast({
				title:'请输入手机号',
				icon:'none'
			})
			return false;
		}
		if(e.detail.value.phone.length != 11){
			wx.showToast({
				title:'请输入正确手机号',
				icon:'none'
			})
			return false;
		}
		if(!e.detail.value.password){
			wx.showToast({
				title:'请输入会员卡号',
				icon:'none'
			})
			return false;
		}
		app.request('/api/Simple/bindMember', {phone:e.detail.value.phone,vipcode:e.detail.value.password}, function(res){
			wx.showToast({
				title:res.msg,
				icon:'none'
			})
		});
	},
	formReset: function() {
	
	},	
	//解除绑定
	relieveMeber:function(){
		wx.navigateTo({
		    url:'/pages/relieveMeber/relieveMeber'
		})
	}
})